tree-list-model: Return the correct item type
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Tue, 18 Sep 2018 03:51:57 +0000 (00:51 -0300)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Tue, 18 Sep 2018 03:51:57 +0000 (00:51 -0300)
When passthrough is enabled, it should return the GType
of the child GListModels; when disabled, it should be
GTK_TYPE_TREE_LIST_ROW.

The conditions are inverted however, causing a few
warnings to trigger.

Fix that by returning the correct GType.

gtk/gtktreelistmodel.c

index a612057d96234b39b12ea12a4bea8177bff9fb35..c619347e5404fdf2813e5c3d638ef9d514eed521 100644 (file)
@@ -576,9 +576,9 @@ gtk_tree_list_model_get_item_type (GListModel *list)
   GtkTreeListModel *self = GTK_TREE_LIST_MODEL (list);
 
   if (self->passthrough)
-    return GTK_TYPE_TREE_LIST_ROW;
-  else
     return g_list_model_get_item_type (self->root_node.model);
+  else
+    return GTK_TYPE_TREE_LIST_ROW;
 }
 
 static guint